package com.lxh.flyweight;

/**
 * 亨元模式
 * Create by lxh on 2020/2/16
 */
public class Main {
    public static void main(String[] args) {
        Circle circle = (Circle) ShapeFactory.getCircle("红色");
        circle.setRadius(10);
        circle.draw();

        Circle circle1 = (Circle) ShapeFactory.getCircle("红色");
        circle.setRadius(20);
        circle1.draw();

        Circle circle2 = (Circle) ShapeFactory.getCircle("白色");
        circle2.setRadius(20);
        circle2.draw();
    }
}
